In a conventional communication system in which a plurality of communication devices communicate with each other via a network, communication applied with a message authenticator, encryption of data, or the like is made in order to enhance the reliability of the communication.
For performing processing such as encryption, the communication devices for making communication need to hold a shared key.
Japanese Patent Laid-Open Publication No. 2009-284086 suggests a cryptographic key updating system which updates a cryptographic key to be used in a shared key cryptographic method. In this cryptographic key updating system, an electronic key and an on-vehicle device preliminarily share secret information with each other, and a hash function is repeatedly applied to the secret information so that a common cryptographic key is obtained as the result. In the process of updating a cryptographic key, a result obtained by applying a hash function the number of times, which is smaller than a previous repeat count by 1, is regarded as a cryptographic key.